﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Kokomo.Mirror.CliMetadata
{
	class CliSyntheticConstructorInfo : ConstructorInfo
	{
		internal CliSyntheticConstructorInfo(
			CliModule module,
			Type declaringType,
			string name,
			MethodAttributes attributes,
			MethodImplAttributes implAttributes,
			CliParameterInfo[] parameters
			)
		{
			this._module = module;
			this._declaringType = declaringType;
			this._name = name;
			this._parameters = parameters;
			this._attributes = attributes;
			this._implAttributes = implAttributes;

			foreach (var parameter in parameters)
			{
				parameter.owner = this;
			}
		}

		public override int MetadataToken
		{
			get
			{
				return 0;
			}
		}

		private CliModule _module;
		public override Module Module
		{
			get { return this._module; }
		}

		public override object Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		private MethodAttributes _attributes;
		public override MethodAttributes Attributes
		{
			get { return this._attributes; }
		}

		private MethodImplAttributes _implAttributes;
		public override MethodImplAttributes GetMethodImplementationFlags()
		{
			return this._implAttributes;
		}

		private ParameterInfo[] _parameters;
		public override ParameterInfo[] GetParameters()
		{
			return this._parameters;
		}

		public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		public override RuntimeMethodHandle MethodHandle
		{
			get { throw new NotImplementedException(); }
		}

		private Type _declaringType;
		public override Type DeclaringType
		{
			get { return this._declaringType; }
		}

		public override object[] GetCustomAttributes(Type attributeType, bool inherit)
		{
			throw new NotImplementedException();
		}

		public override object[] GetCustomAttributes(bool inherit)
		{
			throw new NotImplementedException();
		}

		public override bool IsDefined(Type attributeType, bool inherit)
		{
			return false;
		}

		private string _name;
		public override string Name
		{
			get { return this._name; }
		}

		public override Type ReflectedType
		{
			get { return this._declaringType; }
		}
	}
}
